//
//  VRFirefightingRecordFoldChildCell.m
//  VRFirefighting
//
//  Created by Veer on 2018/8/18.
//  Copyright © 2018年 Veer. All rights reserved.
//

#import "VRFirefightingRecordFoldChildCell.h"

#import "VRFirefightingRecordModel.h"

@interface VRFirefightingRecordFoldChildCell()

@property (nonatomic, weak) UILabel *dateLbl;
@property (nonatomic, weak) UILabel *nameLbl;
@property (nonatomic, strong) UIView *bottomLineView;

@end

@implementation VRFirefightingRecordFoldChildCell

+ (instancetype)cellWith:(UITableView *)tablevie
{
    static NSString *cellID = @"VRFirefightingRecordFoldChildCell";
    
    VRFirefightingRecordFoldChildCell *cell = [tablevie dequeueReusableCellWithIdentifier:cellID];
    
    if (nil == cell) {
        
        cell = [[VRFirefightingRecordFoldChildCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.accessoryType = UITableViewCellAccessoryNone;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        // lieview
        [self setupSubView];
        
    }
    return self;
}


- (void)setupSubView
{

    UIView *selectedBgView = [[UIView alloc] init];
    selectedBgView.backgroundColor = RGB(238, 238, 238);
    self.selectedBackgroundView = selectedBgView;
    
    UILabel *dateLbl = [[UILabel alloc] init];
    dateLbl.textColor = MAINColor;
    dateLbl.font = VRFont(14);
    [self.contentView addSubview:dateLbl];
    self.dateLbl = dateLbl;
    
    UILabel *nameLbl = [[UILabel alloc] init];
    nameLbl.textColor = MAINColor;
    nameLbl.font = VRFont(14);
    [self.contentView addSubview:nameLbl];
    self.nameLbl = nameLbl;
    
    UIView *bottomLineView = [[UIView alloc] init];
    bottomLineView.backgroundColor = RGB(228, 228, 228);
    [self.contentView addSubview:bottomLineView];
    self.bottomLineView = bottomLineView;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.dateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.centerY.mas_equalTo(self.contentView.mas_top).offset(30);
    }];
    
    [self.nameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.contentView.mas_top).offset(30);
    }];

    [self.bottomLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(-0);
        make.bottom.mas_equalTo(self.contentView);
        make.height.mas_equalTo(1);
    }];
}


#pragma mark - action


#pragma mark - setter && getter
- (void)setModel:(VRFirefightingRecordDayData *)model
{
    _model = model;
    
    self.dateLbl.text = model.days;
    self.nameLbl.text = @"发现隐患，已处理完毕";
}

@end
